package com.foreknow.demo13;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
//        for() {
//            //创建一个对象
//            //将对象保存到list集合中
//        }

        Student s1 = new Student(1001,"tom",12,"12121212","neu");
        Student s2 = new Student(1002,"tom2",14,"12121212","neu");
        Student s3 = new Student(1003,"tom3",16,"12121212","neu");

        List<Student> list = new ArrayList<>();
        list.add(s1);
        list.add(s2);
        list.add(s3);

        //调用功能类的写读方法
        Manager manager = new Manager();
//        manager.writeFile(list,"student.txt");

        List<Student> studentList = manager.readFile("student.txt");
        for (Student student:studentList) {
            System.out.println(student.getName());
        }
    }
}
